package com.xx.job.cloudalibabaorderconsumer90.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {

    @Autowired
    public RestTemplate restTemplate;

    @Value("${service.url}")
    public String serviceUrl;


    @RequestMapping("/order/getPort")
    public String getPort(){
        String url = serviceUrl + "/payment/getport";
        ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
        return forEntity.getBody();
    }

}
